/*
 * Copyright (C), 2002-2021, 苏宁易购电子商务有限公司
 * FileName: KafkaTest.java
 * Author:   zhangc
 * Date:     2021/11/05 17:03
 * Description: //模块目的、功能描述
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名    修改时间    版本号       描述
 */
package com.zhangc.kafkatest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zhangc.kafkatest.config.TopicOp;
import com.zhangc.kafkatest.kafka.KafkaSender;

/**
 * 功能描述:<br>
 *
 * @author zhangc
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@RestController
@RequestMapping(value = "/kt")
public class KafkaTest {

    @Autowired
    TopicOp topicOp;
    @Autowired
    KafkaSender sender;

    @RequestMapping(value = "/createTopic")
    public void createTopic() {
        topicOp.createTopic("test_topic");
    }

    @RequestMapping(value = "/queryTopic")
    public String queryTopic() {
        return topicOp.queryTopic("test_topic");
    }

    @RequestMapping(value = "/sendMsg")
    public String sendMsg(String msg) {
        return sender.sendStr("kafka msg send test.....");
    }
}
